﻿
@{
    ViewBag.Title = "ModifyUserinfos";
}
@model justice.ViewModel.UsersInfos
<style>
    .panel {
        width: 50%;
        margin: auto;
    }

    .panel-title {
        text-align: center;
    }

    #alert-mes {
        text-align: center;
        width: 50%;
        margin: auto;
    }

    #sel {
        display: none;
    }

    .sel-office {
        display: none;
    }

    .panel-footer {
        text-align: right;
    }

    .panel-default > .panel-heading {
        color: #fff;
        background-color: #93969A;
        border-color: #93969A;
    }

    .panel-default {
        border-color: #000;
    }

    .btn-submit {
        color: #fff;
        background-color: #93969A;
        border-color: #93969A;
    }

    .btn-return {
        color: #fff;
        background-color: #93969A;
        border-color: #93969A;
    }
</style>
<div id="alert-mes">
    @Html.ValidationMessage("ModifyError")
    <button class="close" data-dismiss="alert">&times;</button>
</div>
<br />
<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title">修改用户</div>
    </div>
    <form action="/BaseInfos/ModifyUser?uid=@Model.UserId" method="post" class="form-horizontal">
        <div class="panel-body">
            <label class="control-label col-xs-2">登录名：</label>
            <div class="input-group col-xs-6">
                <input class="form-control" value="@Model.UserName" id="UN" name="UserName" />
            </div>
            <br />
            <label class="control-label col-xs-2">密码:</label>
            <div class="input-group col-xs-6">
                <input name="userpwd" value="@Model.UserPwd"  class="form-control" />
            </div>
            <br />
            <label class="control-label col-xs-2">单位:</label>
            <div class="input-group col-xs-6">
                @if (Model.InsererName != null)
                {
                    <input name="userpwd" value="@Model.InsererName" disabled="disabled" class="form-control" />
                }
                else
                {
                    <input name="userpwd" value="@Model.JudiciaryName" disabled="disabled" class="form-control" />
                }

            </div>
            <br />
            <label class="control-label col-xs-2">职位:</label>
            <div class="input-group col-xs-6">
                <select id="sel-job" name="role_id" class="form-control" @(Model.RoleName=="管理员"?"disabled":"")  >
                    <option>@Model.RoleName</option>
                    @{
                        foreach (var item in ViewBag.rolelist)
                        {
                            <option value="@item.id">@item.RoleName</option>
                        }
                    }
                </select>
            </div>
        </div>
        <div class="panel-footer">
            <button type="submit" class="btn btn-submit">提交</button>
            <a href="/BaseInfos/UserInfosIndex" class="btn btn-return">返回</a>
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function () {
        if ($('#alert-mes').find('span').html() != "") {
            $('#alert-mes').attr('class', 'alert alert-danger');
            $('.close').css('display', 'block');
        } else {
            $('.close').css('display', 'none');
        }
    })
</script>



